package com.yuehuanghun.admin.generator.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuehuanghun.admin.generator.domain.GenTableColumn;
import com.yuehuanghun.admin.generator.mapper.GenTableColumnMapper;
import com.yuehuanghun.mybatis.milu.ext.BaseServiceImpl;

/**
 * 业务字段 服务层实现
 * 
 * @author yadmin
 */
@Service
public class GenTableColumnServiceImpl extends BaseServiceImpl<GenTableColumn, Long, GenTableColumnMapper>
		implements IGenTableColumnService {
	@Autowired
	private GenTableColumnMapper genTableColumnMapper;

	/**
	 * 查询业务字段列表
	 * 
	 * @param tableId 业务字段编号
	 * @return 业务字段集合
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) {
		return genTableColumnMapper
				.findByLambdaCriteria(p -> p.eq(GenTableColumn::getTableId, tableId).orderAsc(GenTableColumn::getSort));
	}

}
